Sensor system

ABSTRACT

Disclosed is a method for adjusting a sensor signal and a corresponding sensor system comprising a sensor for providing a sensor signal representative of a measure other than temperature, dynamic components of the sensor signal being dependent on temperature. In addition there is provided a temperature sensor for measuring the temperature. Dynamic components in the sensor signal are adjusted subject to the temperature sensed, and a compensated sensor signal is supplied. Such sensor system helps compensating for long response times of sensors.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims the priority of European Patent Application10005804.9, filed Jun. 4, 2010, the disclosure of which is incorporatedherein by reference in its entirety.

BACKGROUND OF THE INVENTION

It is the nature of sensors that they react on real impacts with acertain time lag. Especially, this is true in fast varying environmentsin which the quantity to be measured may change in form of a stepfunction, for example. However, the corresponding sensor signal may notstep up to the new real measure value but rather gets there with acertain response time.

There are many applications that only work properly with a sensorsupplying a fast response to fast varying measures. However, for manysensors there are limitations in modifying the hardware in order toimprove the response time.

BRIEF SUMMARY OF THE INVENTION

The problem to be solved by the present invention is therefore toprovide a sensor and a method for providing a sensor signal withimproved response time. It is also desired to provide a method forbuilding such a sensor system or pieces of it respectively.

The problem is solved by a sensor system according to the features ofclaim 1, by a method for adjusting a sensor signal according to thefeatures of claim 7, and by a method for building a compensation filterfor use in a sensor system according to the features of claim 12.

According to a first aspect of the present invention, there is provideda sensor system comprising a sensor providing a sensor signalrepresentative of a measure other than temperature, wherein dynamiccomponents of the sensor signal are dependent on temperature. The systemfurther includes a temperature sensor for providing a temperaturesignal. A compensation filter receives the sensor signal and thetemperature signal. The compensation filter is designed for adjustingthe dynamic components in the sensor signal subject to the temperaturesignal, and for providing a compensated sensor signal.

According to another aspect of the present invention, there is provideda method for adjusting a sensor signal. According to this method atemperature is sensed and a sensor signal representative of a measureother than temperature is provided. Dynamic components of this sensorsignal typically are dependent on temperature. The dynamic components inthe sensor signal are adjusted subject to the temperature sensed. Acompensated sensor signal is provided as a result of this adjustment.

Sensors may not immediately react to changes in a measure but only reactwith a certain delay, also called response time. Such time lag may beowed to the appearance of diffusion processes, which may include adiffusion of the measure into the sensor—e.g. into a housing of thesensor—and, in addition, possibly a diffusion of the measure into asensor element of the sensor. For some sensors and applications,chemical reactions of the measure with the sensor element may increasethe response time, too. While a sensor may perfectly map a staticmeasure into its sensor signal, dynamic components in the measure, suchas swift changes, steps, or other high-frequent changes may be followedonly with a delay in time.

For such sensors/applications it may be beneficial if the sensorresponse is dynamically compensated. This means, that the sensor signal,and in particular the dynamic components of the sensor signal areadjusted such that the response time of the sensor is decreased. Sucheffort in decreasing the response time of a sensor is also understood ascompensation of the sensor signal and especially its dynamic components.

By using a dynamic compensation filter the response of a sensor, i.e.its output in response to a change in the measure, will be accelerated.If the dynamics of the sensor including its housing are known, anobserver, i.e. a compensation filter, can be implemented to estimate thetrue physical value of the measure. This observer compensates for thesensor dynamics such that the response can be considerably acceleratedin time, which means that the response time can be considerablydecreased. This is why the proposed method and system enNance the systemdynamics of sensors.

It has been observed that the dynamic components of a sensorresponse—e.g. the gradient in the sensor signal—may be dependent on theambient temperature, such that for example the response time of thesensor may be shorter at higher temperatures, and may take longer atlower temperatures. Consequently, in the present embodiments, it isenvisaged to apply a compensating filter to the sensor output whichcompensating filter takes the measured temperature into account. As aresult the compensated sensor signal supplied by the compensating filteris even more enhanced in that its deviation from the real measure isimproved for the reason that temperature dependency of the sensordynamics is taken into account of the compensation filter modelling.

Another aspect of the invention provides a method for building acompensation filter for use in a sensor system. In this method, a sensormodel of the sensor is built, the sensor model being characterized by atransfer function. A compensation filter is modelled based on an inverseof the transfer function of the sensor model. Temperature dependentterms are applied to the compensation filter.

In another aspect of the present invention, there is disclosed acomputer program element for adjusting a sensor signal, the computerprogram element comprising computer program instructions executable by acomputer to receive a sensor signal representative of a measure otherthan temperature, dynamic components of the sensor signal beingdependent on temperature, to adjust the dynamic components in the sensorsignal subject to the temperature sensed, and to provide a compensatedsensor signal.

Other advantageous embodiments are listed in the dependent claims aswell as in the description below. The described embodiments similarlypertain to the system, the methods, and the computer program element.Synergetic effects may arise from different combinations of theembodiments although they might not be described in detail.

Further on it shall be noted that all embodiments of the presentinvention concerning a method might be carried out with the order of thesteps as described, nevertheless this has not to be the only essentialorder of the steps of the method all different orders of orders andcombinations of the method steps are herewith described.

BRIEF DESCRIPTION OF THE DRAWINGS

The aspects defined above and further aspects, features and advantagesof the present invention can also be derived from the examples ofembodiments to be described hereinafter and are explained with referenceto examples of embodiments. The invention will be described in moredetail hereinafter with reference of examples of embodiments but towhich the invention is not limited.

FIG. 1 shows a diagram illustrating a change in a measure and associatedsensor signals for different ambient temperatures,

FIG. 2 shows a schematic illustration of a sensor system according to anembodiment of the present invention in a block diagram,

FIG. 3 illustrates diagrams with sample measures, associated sensorsignals, and associated compensated sensor signals,

FIG. 4 shows graphs of signals in the discrete time domain which signalsappear in a sensor system of an embodiment according to the presentinvention,

FIG. 5 illustrates graphs for supporting the understanding of how tobuild a compensation filter according to an embodiment of the presentinvention,

FIG. 6 illustrates graphs for supporting the understanding of how tobuild a compensation filter according to another embodiment of thepresent invention, and

FIG. 7 illustrates on a temperature scale with different temperaturesub-ranges a measure may be exposed to.

DETAILED DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a diagram with a step function st representing an immediatechange in the quantity of a measure to be measured. An x-axis of thediagram indicates time in s, the y axis indicates the quantity of themeasure to be measured, in this particular case the relative humidityRH(t) in %. Accordingly, at t=0 the relative humidity RH steps up from20% to 80%. The other graphs in the diagram indicate sensor signals overtime provided by a relative humidity sensor in response to the stepfunction st of the relative humidity. It can be derived from thesegraphs that the humidity sensor cannot immediately follow the change inthe measure and approaches the new relative humidity of 80% only with adelay which delay is also called response time. The various graphsrepresent sensor signals subject to different ambient temperatures inCelsius degrees. Basically, the higher the ambient temperature is thefaster the response time of the sensor signal is. The lower the ambienttemperature is the longer the response time of the sensor signal is.

FIG. 2 shows a schematic illustration of a sensor system according to anembodiment of the present invention. A relative humidity sensor 1 sensesthe ambient relative humidity RH. In the following, the term humidity isused as a synonym for relative humidity. The physics of the humiditysensor 1 is such that dynamics of the sensor signal RH_(sensor) at itsoutput is temperature dependent. Insofar, the humidity sensor 1 of FIG.2 may behave according to a humidity sensor providing a temperaturedependent output according to the graphs in FIG. 1. This means that theresponse time of the humidity sensor is dependent from the ambienttemperature T. Accordingly, in FIG. 2 the ambient temperature T isillustrated as input to the humidity sensor 1 although the humiditysensor 1 is not meant to measure the ambient temperature 1 but ratherthe dynamics of the sensor signal RH_(sensor) at its output is varyingsubject to the ambient temperature T.

A second sensor is provided, which is a temperature sensor 2 formeasuring the ambient temperature T. The output of the temperaturesensor 2 provides a temperature signal T representing the ambienttemperature T.

A compensator 3 receives the sensor signal RH_(sensor)(t) overtime—which sensor signal is also denoted as u(t)—and the temperaturesignal T(t) over time, and adjusts the dynamics in the sensor signalRH_(sensor)(t) subject to the temperature signal T(t). As a result ofthis adjustment, the compensator 3 provides at its output a compensatedsensor signal RH_(compensated)(t) over time. In qualitative terms, thecompensated sensor signal RH_(compensated)(t) shall compensate for theresponse time of the humidity sensor 1 at its best and take a gradientthat is more close to the gradient of the measure to be measured. Assuch, the compensator 3 adjusts for the dynamics of the sensor signalRH_(sensor)(t) and consequently for the physics of the sensor 1 notallowing for better response times.

In order to build a compensator 3 that actually compensates for thedynamics of the sensor 1 in the desired way, the behaviour of the sensor1 needs to be understood. While the following sections are described inconnection with humidity sensing, it is understood that the principlescan be generalized to any other sensor which shows a response time notsatisfying for an application the sensor is used in and in particular atemperature dependent response time.

Modelling the Sensor:

The following describes the modelling of a humidity sensor out of whichmodel a suitable compensator may be derived. Such compensator may beapplied down-stream to the real sensor and compensate for dynamics inthe sensor signal output by such sensor.

For a humidity sensor, the humidity as the relevant measure needs toreach a sensing element of the humidity sensor. Such sensing element ofa humidity sensor preferably is a membrane. For further information onhumidity sensing background it is referred to EP 1 700 724.Consequently, the humidity to be measured needs to diffuse into themembrane of the humidity sensor. Prior to this, the humidity needs todiffuse into a housing of the humidity sensor provided the humiditysensor has such housing.

For humidity sensors for which both of these diffusion processes—i.e.from the outside into the housing and from the housing into the sensorelement—are relevant both processes are preferred to be respected in acorresponding sensor model.

Both of the processes may be described with a differential diffusionequation with two independent diffusion time constants. In a firstapproximation, the sensor can be described by a transfer function in thefrequency domain with two poles and one zero such that the genericdesign of a corresponding transfer function G₂(s) may look like,specifically in a second order model:

$\begin{matrix}{{{G_{2}(s)} = \frac{{Ks} + 1}{\left( {{T_{1}s} + 1} \right)\left( {{T_{2}s} + 1} \right)}},} & \left( {{Eq}.\mspace{14mu} 1} \right)\end{matrix}$

where s denotes the complex Laplace variable and K, T₁, T₂ are constantsto be identified. T₁ and T₂ are time constants of the respectivediffusion processes and K defines a coupling between the two processes.The transfer function G(s) generally describes the characteristics ofthe sensor in the frequency domain byRH _(sensor)(s)=G(s)*RH(s)

If the housing of the humidity sensor is very complex, an additionalpole and zero may be added, and the transfer function of the humiditysensor may be amended accordingly.

Some other applications may require a less complex sensorrepresentation. In this case, a first order model may approximate thesensor, which first order model is characterized by a transfer functionin the frequency domain with one pole such that the generic design ofsuch transfer function G₁(s) may look like, specifically in a firstorder model:

$\begin{matrix}{{G_{1}(s)} = {\frac{1}{\left( {{T_{1}s} + 1} \right)}.}} & \left( {{Eq}.\mspace{14mu} 2} \right)\end{matrix}$

Such model may be sufficient, for example, if the humidity sensor doesnot include a housing such that the diffusion process into the housingcan be neglected, or, if one of the two diffusion processes—either fromthe outside into the housing or from the housing into the sensorelement—is dominant over the other, such that the transfer function maybe approximated by the dominant diffusion process only.

There are different ways for identifying the parameters T₁, T₂ and K.One approach is to find the parameters by trial and error. In a firsttrial, the sensor output is simulated by the sensor model wherein thesensor model makes use of a first estimation of the parameters. Theoutput of the sensor model then is compared with the sensor signalsupplied by the real sensor. Afterwards, the parameters are adjusteduntil a deviation between the simulated sensor output and the realsensor signal is acceptably small.

For implementing the sensor model in a digital system such as amicrocontroller the sensor model preferably is implemented in thediscrete time domain rather than in the continuous frequency domain asdescribed by equations 1 or 2. Therefore, the sensor model needs to bedigitised, i.e. transformed into a set of difference equations.

First, the differential equations in the frequency domain, e.g. theequations 1 and 2, can be reverse transformed into the time continuousdomain by the Laplace back-transform.

For the second order model of the sensor according to equation 1 theequivalent time continuous state space description in the controlcanonical form is:

$\begin{bmatrix}\frac{\mathbb{d}{x_{1}(t)}}{\mathbb{d}t} \\\frac{\mathbb{d}{x_{2}(t)}}{\mathbb{d}t}\end{bmatrix} = {{A_{c}^{M} \cdot \begin{bmatrix}{x_{1}(t)} \\{x_{2}(t)}\end{bmatrix}} + {B_{c}^{M}{w(t)}}}$v(t) = C_(c)^(M)x(t) + D_(c)^(M)w(t)

with

w(t) denoting the real relative humidity RH at time t in the timedomain,

x1(t) and x2(t) denoting internal states of the second order sensormodel, and

v(t) denoting the sensor model output over time t.

In this time continuous state space representation, the coefficients A,B, C and D are determined by:

${A_{c}^{M} = \begin{bmatrix}{- \frac{T_{1} + T_{2}}{T_{1}T_{2}}} & \frac{1}{T_{1}T_{2}} \\1 & 0\end{bmatrix}},{B_{c}^{M} = \begin{bmatrix}1 \\0\end{bmatrix}}$ ${C_{c}^{M} = \begin{bmatrix}\frac{K}{T_{1}T_{2}} & \frac{1}{T_{1}T_{2}}\end{bmatrix}},{D_{c}^{M} = 0}$

For a first order sensor model the time continuous state spacedescription in the control canonical form is:

$\frac{\mathbb{d}{x(t)}}{\mathbb{d}t} = {{A_{c}^{M} \cdot {x(t)}} + {B_{c}^{M}{w(t)}}}$v(t) = C_(c)^(M)x(t) + D_(c)^(M)w(t)

again, with

w(t) denoting the real relative humidity RH at time t in the timedomain,

x(t) denoting an internal state of the first order sensor model, and

v(t) denoting the sensor model output over time t.

In this time continuous state space representation, the coefficients A,B, C and D are determined by:

${A_{c}^{M} = {- \frac{1}{T_{1}}}},{B_{c}^{M} = 1},{C_{c}^{M} = \frac{1}{T_{1}}},{D_{c}^{M} = 0}$

Second, the representation in the time continuous domain may betransformed into the time discrete domain.

A time discrete state space representation equivalent to the timecontinuous state space representation for the second order sensor modelmay be:

$\begin{bmatrix}{x_{1}\left( {k + 1} \right)} \\{x_{2}\left( {k + 1} \right)}\end{bmatrix} = {{A_{d}^{M} \cdot \begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {B_{d}^{M}{w(k)}}}$${v(t)} = {{{C_{d}^{M}\begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {D_{d}^{M}{{w(k)}\begin{bmatrix}{x_{1}(0)} \\{x_{2}(0)}\end{bmatrix}}}} = {\left( {I - A_{d}^{M}} \right)^{- 1}{B_{d}^{M} \cdot {w(0)}}}}$

where w denotes the measured relative humidity at time step k with thesampling time t(k+1)−t(k)=T_(s). There are two internal states x₁(k),x₂(k) of the second order sensor model. This means x(k)=(x₁(k),x₂(k))^(T). v(k) denotes the sensor model output in the discrete timedomain.

In this time discrete state space representation, the coefficients A, B,C and D are determined by:A _(d) ^(M) =e ^(A) ^(c) ^(M) ^(T) ^(s) , B _(d) ^(M)=(A _(c) ^(M))⁻¹(e^(A) ^(c) ^(M) ^(T) ^(s) −I)·B _(c) ^(M)C _(d) ^(M) =C _(c) ^(M) , D _(d) ^(M) =D _(c) ^(M)In addition,

$I = \begin{bmatrix}1 & 0 \\0 & 1\end{bmatrix}$and T_(s) is the sampling time.

A time discrete state space representation of the time continuous statespace representation for the first order sensor model may be:

x(k + 1) = A_(d)^(M) ⋅ x(k) + B_(d)^(M) ⋅ w(k)v(k) = C_(d)^(M) ⋅ x(k) + D_(d)^(M) ⋅ w(k)${x(0)} = {\frac{B_{d}^{M}}{1 - A_{d}^{M}}{w(0)}}$

where w(k) denotes the measured relative humidity RH at time step k withthe sampling time t(k+1)t(k)=T. There is an internal state x(k) of thefirst order sensor model. v(k) denotes the modelled sensor output in thediscrete time domain.

In this time discrete state space representation, the coefficients A, B,C and D are determined by:

${A_{d}^{M} = {\mathbb{e}}^{{- T_{1}}T_{s}}},{B_{d}^{M} = {{- \frac{1}{T_{1}}}\left( {{\mathbb{e}}^{{- T_{1}}T_{s}} - 1} \right)}}$C_(d)^(M) = 1, D_(d)^(M) = 0,where T_(s) is the sampling time.

The derivation of the matrices for the first and the second order sensormodel requires Schur decomposition or series expansion and matrixinversion. Computer software may help to calculate the coefficients.

The time discrete state space representations of the first or the secondorder sensor model may be run on a microprocessor, and the parameters T₁or T₁, T₂ and K respectively may be varied until the sensor model outputv(k) is close enough to the real sensor signal u(t) which may be presentin digitized form u(k), too, or may be digitized for comparing purposes.

More sophisticated methodologies for determining the parameters of thesensor model may use system identification tools that automaticallybuild dynamical models from measured data.

Modelling the Compensator:

In a next step, the compensator 3 out of FIG. 2 is determined andimplemented. When the humidity sensor 1 is modelled by a second ordermodel then, advantageously, the compensator is modelled by a secondorder model, too. The transfer function q(s) of such a second ordercompensation filter 3—also denoted as compensator—in the frequencydomain may be described by:

$\begin{matrix}{{C_{2}(s)} = \frac{\left( {{T_{1}s} + 1} \right)\left( {{T_{2}s} + 1} \right)}{\left( {{Ks} + 1} \right)\left( {{Ps} + 1} \right)}} & \left( {{Eq}.\mspace{14mu} 3} \right)\end{matrix}$

If a first order sensor model is applied, the following first ordercompensation filter is proposed, which may be described by a transferfunction C₁(s) in the frequency domain by:

$\begin{matrix}{{C_{1}(s)} = {\frac{\left( {{T_{1}s} + 1} \right)}{\left( {{Ps} + 1} \right)}.}} & \left( {{Eq}.\mspace{14mu} 4} \right)\end{matrix}$

For both models, s denotes the complex Laplace variable and K, T₁, T₂are the constants that were identified when determining the sensormodel.

C(s) generally denotes the transfer function of the compensation filterin the frequency domain, whereinRH _(compensated)=(s)=C(s)*RH _(sensor)(s)

Preferably, the compensation filter transfer function C(s) is theinverse to the sensor model transfer function G(s), i.e. the diffusionfunction, such thatC(s)=1/G(s)

The term (Ps+1) is introduced in the compensator transfer function tomake the function physically applicable. Parameter P is kept small inorder to keep impact on filter function low, but can be used to filtermeasurement noise.

An important feature of the compensation filter transfer function C(s)is that the final value of C(s) converges to 1, i.e.

${\lim\limits_{s->0}{C(s)}} = 1$

This means that the compensation filter 3 only changes the sensor outputcharacteristic during transition. When the compensation filter 3 is insteady state, it does not affect the sensor output, even if themodelling of the sensor and its housing is inaccurate. Please note thatovershoots may occur if the real system response RH(t) is faster thanmodelled.

Typically, the compensation filter 3 is implemented in a digital systemsuch as a microcontroller which operates on samples of the measuredhumidity rather than on the continuous signal. As a consequence,microcontrollers cannot integrate and not implement differentialequations like those in equation 3 or 4. Therefore, the compensatorneeds to be digitised, i.e. transformed into a set of differenceequations.

First, the differential equations in the spectral domain, i.e. theequations 3 and 4 in the present example, can be reverse transformedinto the time continuous domain by the Laplace back-transform.

For the second order compensation filter the time continuous state spacedescription in the control canonical form is:

$\begin{bmatrix}\frac{\mathbb{d}{x_{1}(t)}}{\mathbb{d}t} \\\frac{\mathbb{d}{x_{2}(t)}}{{\mathbb{d}t}\;}\end{bmatrix} = {{A_{c}^{C} \cdot \begin{bmatrix}{x_{1}(t)} \\{x_{2}(t)}\end{bmatrix}} + {B_{c}^{C}{u(t)}}}$y(t) = C_(c)^(C)x(t) + D_(c)^(C)u(t)

with u(t) denoting the measured humidity at time t in the time domain,i.e. the sensor signal RH_(sensor)(t)

x1(t) and x2(t) denoting internal states of the second ordercompensation filter, and

y(t) denoting the compensated sensor signal, i.e. RH_(compensate)(t)according to FIG. 2.

In this time continuous state space representation, the coefficients A,B, C and D are determined by:

${A_{c}^{C} = \begin{bmatrix}\frac{K + P}{KP} & \frac{1}{KP} \\1 & 0\end{bmatrix}},{B_{c}^{C} = \begin{bmatrix}1 \\0\end{bmatrix}},{D_{c}^{C} = \frac{T_{1}T_{2}}{KP}}$$C_{c}^{C} = \begin{bmatrix}{\frac{T_{1} + T_{2}}{KP} - \frac{T_{1}{T_{2}\left( {K + P} \right)}}{({KP})^{2}}} & {\frac{1}{KP} - \frac{T_{1}T_{2}}{({KP})^{2}}}\end{bmatrix}$

For the first order compensation filter the time continuous state spacedescription in the control canonical form is:

$\frac{\mathbb{d}{x(t)}}{\mathbb{d}t} = {{A_{c}^{C} \cdot {x(t)}} + {B_{c}^{C}{u(t)}}}$y(t) = C_(c)^(C)x(t) + D_(c)^(C) u(t)

with u(t) denoting the measured humidity at time t in the time domain,i.e. the sensor signal RH_(sensor)(t) in FIG. 2,

x(t) denoting an internal state of the second order compensation filter,and

y(t) denoting the compensated sensor signal, i.e. RH_(compensated)(t) inFIG. 2.

In this time continuous state space representation, the coefficients A,B, C and D are determined by:

${A_{c}^{C} = {- \frac{1}{P}}},{B_{c}^{C} = 1},{C_{c}^{C} = \frac{P - T_{1}}{P^{2}}},{D_{c}^{C} = \frac{T_{1}}{P}}$

Second, the representation in the time continuous domain may betransformed into the time discrete domain.

A time discrete state space representation of the time continuous statespace representation for the second order compensation filter may be:

$\begin{matrix}{{\begin{bmatrix}{x_{1}\left( {k + 1} \right)} \\{x_{2}\left( {k + 1} \right)}\end{bmatrix} = {{A_{d}^{C} \cdot \begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {B_{d}^{C}{u(k)}}}}{{y(t)} = {{{C_{d}^{C}\begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {D_{d}^{C}{{u(k)}\begin{bmatrix}{x_{1}(0)} \\{x_{2}(0)}\end{bmatrix}}}} = {\left( {I - A_{d}^{C}} \right)^{- 1}{B_{d}^{C} \cdot {u(0)}}}}}} & {{Equ}.\mspace{14mu} 5}\end{matrix}$

where u(k) denotes the measured humidity at time step k with thesampling time t(k+1)−t(k)=T_(s). There are two internal states of thesecond order compensator, i.e. x(k)=(x₁(k), x₂(k)^(T). y(k) denotes thecompensated sensor signal in the discrete time domain.

In this time discrete state space representation, the coefficients A, B,C and D are determined by:A _(d) ^(C) =e ^(A) ^(c) ^(C) ^(T) ^(s)B _(d) ^(C)=(A _(c) ^(C))⁻¹(e ^(A) ^(c) ^(C) ^(T) ^(s) −I)·B _(c) ^(C)C _(d) ^(C) =C _(c) ^(C)D _(d) ^(C) =D _(c) ^(C)

A time discrete state space representation of the time continuous statespace representation for the first order compensation filter may be:

x(k + 1) = A_(d)^(C) ⋅ x(k) + B_(d)^(C) ⋅ u(k)y(k) = C_(d)^(C) ⋅ x(k) + D_(d)^(C) ⋅ u(k)${x(0)} = {\frac{B_{d}^{C}}{1 - A_{d}^{C}}{u(0)}}$

where u(k) denotes the measured humidity at time step k with thesampling time t(k+1)−t(k)=T_(s). There is an internal state x(k) of thefirst order compensator. y(k) denotes the compensated sensor signal inthe discrete time domain.

In this time discrete state space representation, the coefficients A, B,C and D are determined by:

${A_{d}^{C} = {\mathbb{e}}^{- {PT}_{s\;}}},{B_{d}^{C} = {{- \frac{1}{P}}\left( {{\mathbb{e}}^{- {PT}_{s}} - 1} \right)}}$${C_{d}^{C} = \frac{P - T_{1}}{P^{2}}},{D_{d}^{C} = \frac{T_{1}}{P}}$

The derivation of the matrices for the first and the second ordercompensation filter requires Schur decomposition or series expansion andmatrix inversion. Computer software may help to calculate thecoefficients.

FIG. 4 illustrates sample signals, primarily in the discrete timedomain. FIG. 4a illustrates a sample ambient humidity RH over time t.The measured humidity as continuous signal over time is denoted by u(t),i.e. the sensor signal u(t) supplied by the humidity sensor. The sensorsignal u(t) is sampled at points k=0, k=1, . . . with the sampling timeT_(s)=t(k+1)−t(k). u(k) denotes the sampled sensor signal which is atime discrete signal.

For a second order compensation filter the internal states x1 and x2over sampling points k are illustrated in graphs 4 b. In the last graph4 c, the compensated sensor signal is illustrated as step function inthe discrete time domain. For illustration purposes, an equivalent Y inthe continuous time domain is depicted as dot and dash line.

The compensation effect with respect to a sample humidity characteristicover time is also illustrated in the diagrams of FIG. 3. In FIG. 3a ,the relative humidity in the environment, denoted as “Ambient condition”is shown as a function of time and includes three step wise changes anda gradient in form of a ramp. The humidity sensor supplies a sensorsignal—denoted as “Sensor output”—which exhibits significant responsetimes to the fast changes in the Ambient condition. As mentioned before,the Ambient condition is filtered within the sensor because of theinternal diffusion dynamics and the dynamics of the housing. Acompensation filter following the sensor supplies a compensated sensorsignal—denoted as “Compensated output”. In the present example, thecompensation filter is implemented as a second order model. As can bederived from the diagram, the Compensated output much more resembles theAmbient condition than the sensor output does without a compensatorapplied to the sensor output. Consequently, the compensator helps inimproving the quality of the measuring system such that the overalloutput of the sensor system including the compensator provides for abetter quality output especially for fast changes in the Ambientcondition. FIG. 3b illustrates the Sensor output and the CompensatedOutput for another Ambient condition characteristic in form of a sawtooth. In this example, the compensation filter is implemented as afirst order model.

The diagrams in FIG. 5 support the illustration of a method forimplementing a sensor system according to an embodiment of the presentinvention. In a first step, the sensor itself is modelled for thepurpose of deriving a compensator model from the data that describes thesensor model. In this first step, the real sensor again is exposed to astep wise increase of the measure, i.e. the relative humidity denoted as“Ambient condition” again. The relative humidity RH is increased in asingle step from about 15% to about 65%. The corresponding Sensor outputis measured, and preferably stored. The Sensor output exhibiting aresponse time is plotted in both FIG. 5a and FIG. 5b . Up-front, it isdetermined, that the humidity sensor used may best be represented by afirst order model. Consequently, in a second step, the sensor model isbuilt by means of the transfer function:

${G_{1}(s)} = \frac{1}{\left( {{T_{1}s} + 1} \right)}$

and the parameter T₁ needs to be determined. In order to determine theparameter T₁ such that the output of the sensor model fits the realSensor output as depicted in FIG. 5 best, the first order type sensormodel is implemented on a microcontroller in the time discrete statespace according to the equations that were explained previously:

x(k + 1) = A_(d)^(M) ⋅ x(k) + B_(d)^(M) ⋅ w(k)v(k) = C_(d)^(M) ⋅ x(k) + D_(d)^(M) ⋅ w(k)${x(0)} = {\frac{B_{d}^{M}}{1 - A_{d}^{M}}{w(0)}}$With coefficients

${A_{d}^{M} = {\mathbb{e}}^{{- T_{1}}T_{s}}},{B_{d}^{M} = {{- \frac{1}{T_{1}}}\left( {{\mathbb{e}}^{{- T_{1}}T_{s}} - 1} \right)}}$C_(d)^(M) = 1, D_(d)^(M) = 0

In this time discrete state space representation of the sensor model, aninitial value of the parameter T₁ is chosen, e.g. T₁=6s. The sensormodel output with T₁=6s is illustrated in FIG. 5a . The sensor model isalso run with parameters T₁=8s and T₁=12s. The corresponding sensormodel output is illustrated in FIG. 5a , too.

In a next step, the value of the parameter is chosen that makes thesensor model output come closest to the real sensor signal. From FIG. 5ait can be derived, that this is the case for T₁=8s. Accordingly, thecomplete transfer function of the sensor model in the frequency domainis

${G_{1}(s)} = \frac{1}{\left( {{8s} + 1} \right)}$

While its representation in the time discrete domain is

x(k + 1) = 0.8465 ⋅ x(k) + 0.9211 ⋅ w(k) v(k) = 0.1667x(k) + 0 ⋅ w(k)${x(0)} = {\frac{0.9211}{1 - 0.8465}{w(0)}}$

The method can be modified in that the sensor is modelled first with afirst value of the parameter. If the deviation of the sensor outputbased on the model with the first parameter value is too large, anothervalue for the parameter is chosen. Iteratively, as many parameter valuesare chosen as long as there is considered to be sufficient similaritybetween the sensor model output and the real sensor signal, i.e. thedeviation between those two is below a threshold.

In a next step, the compensator model is determined to be a first ordermodel with a general representation in the frequency domain of

${C_{2}(s)} = \frac{{T_{1}s} + 1}{{Ps} + 1}$

The representation in the time discrete state space according to theabove is:

x(k + 1) = A_(d)^(C) ⋅ x(k) + B_(d)^(C) ⋅ u(k)y(k) = C_(d)^(C) ⋅ x(k) + D_(d)^(C) ⋅ u(k)${x(0)} = {\frac{B_{d}^{C}}{1 - A_{d}^{C}}{u(0)}}$

with u(k) denoting the discrete input to the compensator, i.e. thediscrete representation of output of the real sensor, and y(k) denotingthe discrete output of the compensator, i.e. the compensated sensorsignal in the time discrete domain. The corresponding coefficients are:

${A_{d}^{C} = {\mathbb{e}}^{- {PT}_{s}}},{B_{d}^{C} = {{- \frac{1}{P}}\left( {{\mathbb{e}}^{- {PT}_{s}} - 1} \right)}}$${C_{d}^{C} = \frac{P - T_{1}}{P^{2}}},{D_{d}^{C} = \frac{T_{1}}{P}}$

With the determination of the parameter T₁ upon implementation of thesensor model, the coefficients A-D of the compensator can now bedetermined. In this step, parameter P is chosen, too. Parameter Peffects reducing the signal noise.

The compensator can now be implemented. In its time discrete statespace, the compensator is described by:

x(k + 1) = 0.3679 ⋅ x(k) + 0.6321 ⋅ u(k) y(k) = 8.0 ⋅ x(k) + −7.0 ⋅ u(k)${x(0)} = {\frac{0.6321}{1 - 0.3679}{u(0)}}$

The compensator now can be validated on the data measured. P can beadjusted to best performance in the signal to noise ratio SNR.

In the present embodiment, parameter P is chosen as P=1.

The Compensated output is shown in FIG. 5b . The response time islimited compared to the uncompensated Sensor output. The compensator, ofcourse works for all kinds of signals

The diagrams in FIG. 6 support the illustration of a method forimplementing a sensor system according to another embodiment of thepresent invention. In contrast to the embodiment of FIG. 5 the sensormodel and the compensator now are described as a second order model.Besides, the steps of implementing the sensor system including thecompensator are the same as described in connection with FIG. 5. Again,in a first step, the sensor itself is modelled for the purpose ofderiving a compensator model from the data that describes the sensormodel. In this first step, the real sensor again is exposed to a stepwise increase of the measure, i.e. the relative humidity denoted as“Ambient condition” again. The relative humidity RH is increased in asingle step from about 15% to about 65%. The corresponding Sensor outputis measured, and preferably stored. The Sensor output exhibiting aresponse time is plotted in all FIGS. 5a, 5b and 5c . Consequently, in asecond step, the sensor model is built by means of the transferfunction:

${G_{2}(s)} = \frac{{Ks} + 1}{\left( {{T_{1}s} + 1} \right)\left( {{T_{2}s} + 1} \right)}$

and the parameter T₁, T2 and K need to be determined. In order todetermine the parameter such that the output of the sensor model fitsthe real Sensor output as depicted in FIG. 6a best, the sensor model isimplemented on a microcontroller in the time discrete state spaceaccording to the equations as given above. Initial values of theparameters are chosen and in an iterative way the parameters are setsuch that the output of the sensor model fits the sensor signal of thereal sensor best. In FIG. 6a , there are illustrated multiple outputs ofsensor models implemented with different parameter settings. It can bederived, that the parameter setting of T₁=16, T₂=155, and K=90 fitsbest. With such a parameter setting, the description of the sensor modelin the time discrete state space is finalized.

In a next step, the compensator model is built as a second order modelwith a representation in the frequency domain—including the parametersas determined while building the sensor model, and assuming parameter Pto be set to P=20:

${C_{2}(s)} = \frac{\left( {{16s} + 1} \right)\left( {{155s} + 1} \right)}{\left( {{90s} + 1} \right)\left( {{20s} + 1} \right)}$

This compensator model can be described in the time discrete state spaceby:

$\begin{bmatrix}{x_{1}\left( {k + 1} \right)} \\{x_{2}\left( {k + 1} \right)}\end{bmatrix} = {{\begin{bmatrix}{9.78 \cdot 10^{- 1}} & {{- 2.20} \cdot 10^{- 4}} \\{1.98 \cdot 10^{- 1}} & {1.00 \cdot 10^{- 1}}\end{bmatrix} \cdot \begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {\begin{bmatrix}0.198 \\0.020\end{bmatrix}{u(k)}}}$ ${y(k)} = {{{\begin{bmatrix}{- 0.116} & {- 0.00195}\end{bmatrix}\begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {2.756{{u(k)}\begin{bmatrix}{x_{1}(0)} \\{x_{2}(0)}\end{bmatrix}}}} = {\begin{bmatrix}0 \\1800\end{bmatrix} \cdot {u(0)}}}$

Again, the compensator now can be validated on the data measured. TheCompensated output is shown in FIG. 6b and FIG. 6c . Both Compensatedoutputs differ in that different parameters P are applied. While in FIG.6b , P is set to P=10, the Compensated output is exposed to significantnoise. In FIG. 6c P is set to P=20 which, provides a much better signalto noise ratio SNR.

However, diffusion processes in general depend very much on temperature.Therefore, the model for the compensating filter preferably takestemperature dependency into account—especially if temperature varies bymore than 10-20° C. This can be easily achieved by making the constantsT1, T2, . . . , K, . . . time dependent or by using a set of sensormodels G_(i)(s) and corresponding compensator models C_(i)(s) fordifferent temperature ranges and switching amongst them.

In a preferred embodiment, a second order temperature dependent sensormodel may be described in the frequency domain by:

${G_{2}\left( {s,T} \right)} = \frac{{Ks} + 1}{\left( {{{T_{1}(T)}s} + 1} \right)\left( {{{T_{2}(T)}s} + 1} \right)}$

with T being the temperature.

The corresponding compensation filter may be described by

${C_{2}\left( {s,T} \right)} = \frac{\left( {{{T_{1}(T)}s} + 1} \right)\left( {{{T_{2}(T)}s} + 1} \right)}{\left( {{Ks} + 1} \right)\left( {{Ps} + 1} \right)}$

In the time continuous state space, the following equations representthe temperature dependent compensator:

$\frac{\mathbb{d}{x_{1}(t)}}{\mathbb{d}t} = {{{a_{11}(T)}x_{1}} + {{a_{12}(T)}x_{2}} + {{b_{1}(T)}{u(t)}}}$$\frac{\mathbb{d}{x_{2}(t)}}{\mathbb{d}t} = {{{a_{21}(T)}x_{1}} + {{a_{22}(T)}x_{2}} + {{b_{2}(T)}{u(t)}}}$y(t) = c₁x₁ + c₂x₂

In the time discrete state space, the following equations represent thetemperature dependent compensator:x(k+1)=A _(d) ^(C)(T)·x(k)+B _(d) ^(C)(T)·u(k)y(k)=C _(d) ^(C)(T)·x(k)+D _(d) ^(C)(T)·u(k)

with coefficients

${A_{d}^{C}(T)} = \begin{bmatrix}{a_{11}^{1} + {a_{11}^{2}T}} & {a_{12}^{1} + {a_{12}^{2}T}} \\{a_{21}^{1} + {a_{21}^{2}T}} & {a_{22}^{1} + {a_{22}^{2}T}}\end{bmatrix}$ ${B_{d}^{C}(T)} = \begin{bmatrix}{b_{1}^{1} + {b_{1}^{2}T}} \\{b_{2}^{1} + {b_{2}^{2}T}}\end{bmatrix}$ ${C_{d}^{C}(T)} = \begin{bmatrix}1 & 1\end{bmatrix}$ D_(d)^(C)(T) = [d¹ + d²T]

The determination of A_(d) ^(C)(T) may be complex. A linearinterpolation of matrix elements may be an appropriate way to determinethe coefficients.

Alternatively, the temperature range is divided into n sub-ranges i,with temperature sub-range i=0 being the first one, and temperaturesub-range i=n being the last one spanning the temperature range covered.For each sub-range i a different sensor model and consequently adifferent compensator model is determined. For example, the followingcompensation filter models are determined in the frequency domain fortemperature sub-ranges [i=0, . . . , i=n]:C ₂ ¹(s),C ₂ ²(s),C ₂ ³(s),C ₂ ⁴(s), . . . ,C ₂ ^(n)(s)

And accordingly, the different transfer functions are transformed eachin the time discrete sate space such that for each temperature range acorresponding compensator model, which may be different from thecompensator models for the other temperature ranges, may be provided,stored, and applied whenever the ambient temperature is identified tofall within the corresponding temperature sub-range.

In execution, as illustrated in connection with FIG. 2, the temperaturesensor 2 determines the temperature T and supplies such temperaturesignal to the compensator 3. The compensator 3 determines in whichtemperature sub-range i the measured temperature T falls into, andapplies the compensator model that is defined for such temperaturesub-range. The sensor signal u(t) is then compensated by such selectedcompensator model 3. As a result the entire sensor system comprising thesensor 1, the temperature sensor 2 and the compensator 3 not onlycompensates for response times, it compensates also for temperaturedependencies in the sensor signal. By this means, the sensor system canbe applied to environments with fast changing measures whichenvironments are also characterized to be operated under varyingtemperatures.

Whenever temperature is determined to be in sub-range i, i.e. if T is inT_(i), then k=I and the corresponding compensator model is applied:x(k+1)=A _(d) ^(k)(T)·x(k)+B _(d) ^(k)(T)·u(k)y(k)=C _(d) ^(k)(T)·x(k)+D _(d) ^(k)(T)·u(k)

In FIG. 7 there is illustrated a sample temperature range T divided intoi=4 sub-ranges, with [i=0, . . . i=n=4]. The dashed line shows atemperature characteristic taken by the temperature sensor 2 out of FIG.2. The temperature rises first from a temperature in sub-range i=2 to atemperature in sub-range i=3, then falls back to a temperature insub-range i=2, and further drops to a temperature in sub-range i=1.Consequently, during this measurement cycle, three compensator modelsare applied in sequence to the humidity sensor signal, i.e. the modelsi=2, i=3, i=2 again and finally i=1 corresponding to the temperatureranges.

The compensator 3 including its models may preferably be implemented insoftware, in hardware, or in a combination of software and hardware.

Preferably, the sensor system and the corresponding methods may beapplied in the antifogging detection for vehicles. In such application,it is preferred that the sensor 1 is a humidity sensor. The humiditysensor may be arranged on or close to a pane such as a windscreen, forexample. In addition, the temperature sensor may be arranged on or closeto the pane, too, for measuring the ambient temperature, preferably atthe same location the humidity sensor covers.

The results of the measurements may be used to take action against afogged windscreen, for, example, and start operating a blower.

The invention claimed is:
 1. A sensor system, comprising a sensorproviding a sensor signal representative of a measure other thantemperature, dynamic components of the sensor signal being dependent ontemperature, a temperature sensor for providing a temperature signal, acompensation filter receiving the sensor signal and the temperaturesignal, wherein the compensation filter is designed for adjusting thedynamic components in the sensor signal subject to the temperaturesignal, and for providing a compensated sensor signal, wherein thecompensation filter comprises multiple different compensation models,wherein each of said compensation models is provided in a spectraldomain and is associated to a temperature sub-range, and wherein eachcompensation model itself is invariant to changes in temperature.
 2. Asensor system according to claim 1, wherein the compensation filtercomprises a temperature continuous compensation model.
 3. A sensorsystem according to claim 1, wherein the compensation filter is designedfor determining a sub-range where the temperature signal falls within,and for applying the compensation model associated with the determinedsub-range.
 4. A sensor system according to claim 1, wherein the sensoris a humidity sensor.
 5. A sensor system according to claim 4, whereinthe humidity sensor and the temperature sensor are arranged on a pane ofa vehicle for detecting fogging of the pane.
 6. A method for adjusting asensor signal, comprising the steps of: (a) sensing a temperature, (b)providing a sensor signal representative of a measure other thantemperature, dynamic components of the sensor signal being dependent ontemperature, and (c) by a computing device configured for doing so, (i)adjusting the dynamic components in the sensor signal subject to thetemperature sensed, and (ii) providing a compensated sensor signal,wherein the dynamic components in the sensor signal are adjusted byapplying multiple different compensation models, wherein each of saidcompensation models is provided in a spectral domain and is associatedto a temperature sub-range, wherein each compensation model itself isinvariant to changes in temperature, and wherein said steps are executedon a sensor system according to claim
 1. 7. A method according to claim6, wherein the dynamic components in the sensor signal are adjusted byapplying a temperature continuous compensation model.
 8. A methodaccording to claim 6, wherein a temperature sub-range is determinedwhere the sensed temperature falls within, and wherein the compensationmodel associated with the determined temperature sub-range is applied tothe sensor signal.
 9. A method according to claim 6, wherein the sensorsignal represents measured humidity, and wherein the compensated sensorsignal is used in an antifogging application in a vehicle.